Integrand size = 23, antiderivative size = 46 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b) d} \]
[Out]
Time = 0.06 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3751, 492, 212, 211} \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {b} d (a+b)} \]
[In]
[Out]
Rule 211
Rule 212
Rule 492
Rule 3751
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^2}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{(a+b) d}-\frac {a \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tanh (c+d x)\right )}{(a+b) d} \\ & = \frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b) d} \\ \end{align*}
Time = 0.04 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.02 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {b}}+\text {arctanh}(\tanh (c+d x))}{(a+b) d} \]
[In]
[Out]
Time = 0.12 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.57
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 a +2 b}-\frac {a \arctan \left (\frac {b \tanh \left (d x +c \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 a +2 b}}{d}\) | \(72\) |
default | \(\frac {\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 a +2 b}-\frac {a \arctan \left (\frac {b \tanh \left (d x +c \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 a +2 b}}{d}\) | \(72\) |
risch | \(\frac {x}{a +b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {2 \sqrt {-a b}-a +b}{a +b}\right )}{2 b \left (a +b \right ) d}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 \sqrt {-a b}+a -b}{a +b}\right )}{2 b \left (a +b \right ) d}\) | \(108\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 81 vs. \(2 (38) = 76\).
Time = 0.29 (sec) , antiderivative size = 486, normalized size of antiderivative = 10.57 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\left [\frac {2 \, d x + \sqrt {-\frac {a}{b}} \log \left (\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (d x + c\right )^{2} + a^{2} - 6 \, a b + b^{2} + 4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) - 4 \, {\left ({\left (a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} \sinh \left (d x + c\right )^{2} + a b - b^{2}\right )} \sqrt {-\frac {a}{b}}}{{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b}\right )}{2 \, {\left (a + b\right )} d}, \frac {d x - \sqrt {\frac {a}{b}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )} \sqrt {\frac {a}{b}}}{2 \, a}\right )}{{\left (a + b\right )} d}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 253 vs. \(2 (37) = 74\).
Time = 2.08 (sec) , antiderivative size = 253, normalized size of antiderivative = 5.50 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\tanh {\left (c + d x \right )}}{d}}{a} & \text {for}\: b = 0 \\\frac {x}{b} & \text {for}\: a = 0 \\\frac {d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {\tanh {\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x \tanh ^{2}{\left (c \right )}}{a + b \tanh ^{2}{\left (c \right )}} & \text {for}\: d = 0 \\- \frac {a \log {\left (- \sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d \sqrt {- \frac {a}{b}} + 2 b^{2} d \sqrt {- \frac {a}{b}}} + \frac {a \log {\left (\sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d \sqrt {- \frac {a}{b}} + 2 b^{2} d \sqrt {- \frac {a}{b}}} + \frac {2 b d x \sqrt {- \frac {a}{b}}}{2 a b d \sqrt {- \frac {a}{b}} + 2 b^{2} d \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 215 vs. \(2 (38) = 76\).
Time = 0.30 (sec) , antiderivative size = 215, normalized size of antiderivative = 4.67 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, \sqrt {a b} {\left (a + b\right )} d} + \frac {\arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{2 \, \sqrt {a b} d} + \frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, \sqrt {a b} {\left (a + b\right )} d} + \frac {\log \left ({\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a - b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{4 \, {\left (a + b\right )} d} - \frac {\log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{4 \, {\left (a + b\right )} d} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.41 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\frac {a \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {d x + c}{a + b}}{d} \]
[In]
[Out]
Time = 0.10 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.83 \[ \int \frac {\tanh ^2(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {x}{a+b}-\frac {a\,\mathrm {atan}\left (\frac {b\,\mathrm {tanh}\left (c+d\,x\right )}{\sqrt {a\,b}}\right )}{d\,\sqrt {a\,b}\,\left (a+b\right )} \]
[In]
[Out]